//
//  UIView+Frame.m
//  MallManage_IOS
//
//  Created by 张浩 on 2023/9/11.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)


- (void)setMM_s:(CGSize)MM_s
{
    CGRect frame = self.frame;
    frame.size = MM_s;
    self.frame = frame;
}

- (CGSize)MM_s
{
    return self.frame.size;
}

- (CGFloat)MM_x
{
    return self.frame.origin.x;
}

- (void)setMM_x:(CGFloat)MM_x
{
    CGRect frame = self.frame;
    frame.origin.x = MM_x;
    self.frame = frame;
}

- (CGFloat)MM_Max_X
{
    return self.frame.origin.x + self.frame.size.width;
}

- (void)setMM_Max_X:(CGFloat)MM_Max_X
{
    CGRect frame = self.frame;
    frame.origin.x = MM_Max_X - frame.size.width;
    self.frame = frame;
}

- (CGFloat)MM_y
{
    return self.frame.origin.y;
}

- (void)setMM_Max_Y:(CGFloat)MM_Max_Y
{
    CGRect frame = self.frame;
    frame.origin.y = MM_Max_Y;
    self.frame = frame;
}

- (CGFloat)MM_Max_Y
{
    return self.frame.origin.y + self.frame.size.height;
}

- (void)setMM_y:(CGFloat)MM_y
{
    CGRect frame = self.frame;
    frame.origin.y = MM_y - frame.size.height;
    self.frame = frame;
}

- (CGFloat)MM_w
{
    return self.frame.size.width;
}

- (void)setMM_w:(CGFloat)MM_w
{
    CGRect frame = self.frame;
    frame.size.width = MM_w;
    self.frame = frame;
}

- (CGFloat)MM_h
{
    return self.frame.size.height;
}

- (void)setMM_h:(CGFloat)MM_h
{
    CGRect frame = self.frame;
    frame.size.height = MM_h;
    self.frame = frame;
}

- (CGFloat)MM_Center_X
{
    return self.center.x;
}

- (void)setMM_Center_X:(CGFloat)MM_Center_X {
    CGPoint center = self.center;
    center.x = MM_Center_X;
    self.center = center;
}

- (CGFloat)MM_Center_Y
{
    return self.center.y;
}

- (void)setMM_Center_Y:(CGFloat)MM_Center_Y {
    CGPoint center = self.center;
    center.y = MM_Center_Y;
    self.center = center;
}
@end
